﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	x:Class="Kuvankatselin.Kuva"
	x:Name="UserControl" Height="400" MouseDown="Kuva_MouseDown" MouseMove="Kuva_MouseMove" MouseUp="Kuva_MouseUp" Width="600" MouseWheel="Kuva_MouseWheel">
	<UserControl.Resources>
		<!-- Resources scoped at the Application level should be defined here. -->
		<Storyboard x:Key="OnMouseEnter1">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="slider">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0.495"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="OnMouseLeave1">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="slider">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0.495"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="OnMouseEnter2"/>
	</UserControl.Resources>
	<UserControl.Triggers>
		<EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="slider">
			<BeginStoryboard x:Name="OnMouseEnter1_BeginStoryboard" Storyboard="{StaticResource OnMouseEnter1}"/>
		</EventTrigger>
		<EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="slider">
			<BeginStoryboard x:Name="OnMouseLeave1_BeginStoryboard" Storyboard="{StaticResource OnMouseLeave1}"/>
		</EventTrigger>
	</UserControl.Triggers>

	<Grid x:Name="LayoutRoot">
        <Image Name="kuva" Stretch="Uniform" />
        <Slider x:Name="slider" Margin="8,0,8,8" VerticalAlignment="Bottom" Opacity="0" Minimum="5" Maximum="100" ValueChanged="KoonVaihtaja_ValueChanged" SmallChange="1" Value="50" TickFrequency="1" TickPlacement="None" />
    </Grid>
</UserControl>